﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SlaughterItem.Common.DBContext
{
    public class DbContextDesignTimeFactory : IDesignTimeDbContextFactory<EFDBContext>
    {
        public EFDBContext CreateDbContext(string[] args)
        {
            DbContextOptionsBuilder<EFDBContext> builder = new DbContextOptionsBuilder<EFDBContext>();
            builder.UseSqlServer("server=8.140.206.121;uid=sa;pwd=whq20050625.;database=SlaughterItemSQLServerNew;");
            return new EFDBContext(builder.Options);
            //DbContextOptionsBuilder<EFDBContext> builder = new DbContextOptionsBuilder<EFDBContext>();
            //builder.UseSqlServer("server=10.223.4.24;uid=sa;pwd=123456;database=SlaughterItemSQLServerNew;");
            //return new EFDBContext(builder.Options);
        }
    }
}
